<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>商品劵管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${s.base}/css/base/base.css?123456" media="all" /></head>

<body class="childrenBody">
<form class="layui-form">
	<blockquote class="layui-elem-quote quoteBox" id="tool">
		<div class="layui-inline">
			<label class="layui-input-inline">昵称</label>
			<label class="layui-input-inline">
				<input type="text" class="layui-input" name="memberNickName" placeholder="请输入昵称" />
			</label>
			<label class="layui-input-inline">姓名</label>
			<label class="layui-input-inline">
				<input type="text" class="layui-input" name="memberName" placeholder="请输入姓名" />
			</label>
			<label class="layui-input-inline">手机号</label>
			<label class="layui-input-inline">
				<input type="text" class="layui-input" name="memberPhone" placeholder="请输入手机号" />
			</label>
			<label class="layui-input-inline">卷标题</label>
			<label class="layui-input-inline">
				<input type="text" class="layui-input" name="itemName" placeholder="请输入卷标题" />
			</label>

			<a class="layui-btn search_btn" lay-submit="" lay-filter="seacherBtn">搜索</a>
		</div>
	</blockquote>
	<table id="entityList" lay-filter="entityList"></table>
</form>
<script type="text/html" id="entityBar">
	<a class="layui-btn cy-btnbg-edit layui-btn-sm" lay-event="edit"> 编辑 </a>
	<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a >
</script>
<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script type="text/javascript">layui.use(['jquery', 'pageUtil', 'table', 'dateUtil'],
    function() {
        var $ = layui.jquery,
            dateUtil = layui.dateUtil,
            table = layui.table,
            pageUtil = layui.pageUtil;
        var tableIns = null;
        var url = "/shopOrderCoupon/page";
        var cols = [{
            type: 'checkbox',
            fixed: 'left'
        },
		{
			type: 'numbers',
			title: '序号'
		},
		{
			field: 'memberNickName',
			title: '昵称',
			align: 'center'
		},
		{
			field: 'memberName',
			title: '姓名',
			align: 'center'
		},
		{
			field: 'memberPhone',
			title: '手机号',
			align: 'center'
		},
		{
			field: 'itemName',
			title: '商品名称',
			align: 'center'
		},
		{field: 'image', title: '卷图片',align:'center', templet:function(d){
			return "<img src='"+d.image+"' style='width: 80px;height: 80px;'/>";
		},width:100},
		{field: 'qrImage', title: '劵信息',align:'center', templet:function(d){
			return "<img src='"+d.qrImage+"' style='width: 80px;height: 80px;'/>";
		},width:100},
		{
			field: 'price',
			title: '劵价格',
			align: 'center'
		},
		{
			field: 'brandName',
			title: '品牌名称',
			align: 'center'
		},
		{
			field: 'catName',
			title: '分类名称',
			align: 'center'
		},
		{field: 'status', title: '交易状态',align:'center', templet:function(d){
            if (d.status == "1") {
                return "待入库";
			} else if (d.status == "2") {
                return "已入库";
			} else if (d.status == "3") {
                return "已下架";
            } else if (d.status == "4") {
                return "已交易";
            }
		},width:100},
		{field: 'issueStatus', title: '纠纷状态',align:'center', templet:function(d){
            if (d.issueStatus == "1") {
                return "无纠纷";
            } else if (d.issueStatus == "2") {
                return "纠纷中";
            } else if (d.issueStatus == "3") {
                return "纠纷无效";
            } else if (d.issueStatus == "4") {
                return "纠纷有效";
            }
		},width:100},
		{
			field: 'issueMessage',
			title: '纠纷原因',
			align: 'center'
		},
		{
			field: 'uploadTime',
			title: '上传时间',
			width: 190,
			align: 'center',
			templet: function(d) {
				return dateUtil.formatDate(new Date(d.uploadTime), "yyyy-MM-dd HH:mm:ss");
			}
		},
		{
			field: 'manageTime',
			title: '处理时间',
			width: 190,
			align: 'center',
			templet: function(d) {
				return dateUtil.formatDate(new Date(d.manageTime), "yyyy-MM-dd HH:mm:ss");
			}
		},
		{
			title: '操作',
			width: 150,
			templet: '#entityBar',
			align: "center",
			fixed: 'right'
		}];
        tableIns = pageUtil.initDate(cols, url, true);
        table.on('tool(entityList)',
            function(obj) {
                var layEvent = obj.event,
                    data = obj.data;
                if (layEvent === 'edit') {
                    pageUtil.editPopup("编辑", "/shopOrderCoupon/getEntity?id=" + data.id);
                } else if (layEvent === 'del') {
                    pageUtil.delete("确定删除该项吗？", "/shopOrderCoupon/delete", {
                            "id": data.id,
                            "_method": "DELETE"
                        },
                        function(data) {
                            tableIns.reload();
                        });
                }
            });
    })</script>
</body>

</html>